package model;


public class UserException extends Exception
{

    protected String defaultException = 
	    "Ошибка!";
    
    protected String userMessage = null;
    
    public UserException(String userMessage)
    {
	this.userMessage = userMessage;
    }
    
    public UserException()
    {
	
    }
    
    public String toString()
    {
	if( userMessage != null)
	    return userMessage;
	
	return defaultException;	
    }
    
    public String getMessage()
    {
	if( userMessage != null)
	    return userMessage;
	
	return defaultException;
    }
    
    public void setUserException(String msg)
    {
	userMessage = msg;
    }
    
    private static final long serialVersionUID = 1L;

}
